feat(metrics): expose velero_build_info gauge - #9934
Conversation
👷 Deploy request for velero pending review.Visit the deploys page to approve it
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@ywk253100 Thanks for the review and approval. Pushed If this looks good to you, would you be able to merge when checks pass? Happy to address anything else. |
|
@ywk253100 Thanks again for the earlier review. Your approval got dismissed when I pushed |
Register a velero_build_info Prometheus metric labeled with version, git commit, tree state, and Go runtime details at server startup. Fixes velero-io#2128. Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
The build-info metric needs Go's standard `runtime` package, but pkg/cmd/server/server.go already imports `k8s.io/apimachinery/pkg/runtime` under the same name, which broke the build (`runtime` redeclared, `runtime.NewScheme` undefined). Alias the standard library import as `goruntime` and use it for the build-info values, leaving the apimachinery `runtime` untouched. Also add the required changelog entry for this PR. Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
0a86c69 to
86f1305
Compare
|
@ywk253100 pushed a coverage bump after the last review. Could you re-approve when you get a chance? |
kaovilai
left a comment
There was a problem hiding this comment.
Adds a velero_build_info gauge exposing version/git SHA/tree-state/Go runtime as labels, following the standard Prometheus build_info convention. has-unit-tests (verifies all six labels + gauge value), changelog present, CI green.
Note
Responses generated with Claude
Signed-off-by: Aaron <amark@g.jct.ac.il>
Summary
Fixes #2128.
Registers
velero_build_infoat server startup with labels for version, git commit, tree state, and Go runtime details.Testing
go test ./pkg/metrics/...